package com.luke.springcloud.config;

import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import javax.sql.DataSource;

/**
 * 测试健康检查
 * 参考：https://www.jianshu.com/p/df61a3273528
 * url:http://192.168.0.104:8088/actuator/health
 */
@Component
public class MyDBConfig {

    @Bean
    public DataSource dataSource(){
        return DataSourceBuilder.create()
                .driverClassName("com.mysql.jdbc.Driver")
                .url("jdbc:mysql://localhost:3306/mysql?useUnicode=true&characterEncoding=utf-8&useSSL=false")
                .username("root")
                .password("123456").build();
    }

}
